package com.zzw;

import com.zzw.gatewayfilter.tokenfilter.TokenFilterConfiguration;
import com.zzw.globalfilter.RequestContextFilter;
import com.zzw.redislimter.RLimterAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author Administrator
 */
@Configuration
@ConditionalOnProperty(prefix = "zzw.gateway", name = "enable", matchIfMissing = true)
@Import({TokenFilterConfiguration.class, RLimterAutoConfiguration.class})
public class GatewayAutoConfiguration {

    @Bean
    public RequestContextFilter requestContextFilter() {
        return new RequestContextFilter();
    }
}
